﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Drawing.Drawing2D;

namespace Shapes
{
	public partial class Line : UserControl
	{
		public Line()
		{
			InitializeComponent();
		}

		private void UserControl1_Load(object sender, EventArgs e)
		{
			UpdateRegion();
		}

		private void UpdateRegion()
		{
			GraphicsPath graphicsPath = new GraphicsPath();
			graphicsPath.AddLine(0, 1, this.Width-1, this.Height);
			graphicsPath.AddLine(1, 0, this.Width, this.Height-1);
			Region = new Region(graphicsPath);
		}

		private void UserControl1_Resize(object sender, EventArgs e)
		{
			UpdateRegion();
		}
	}
}
